home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / util / moni / Scout-src.lha / netinclude / rpcsvc / mount.x < prev    next >
Text File  |  2002-09-16  |  3KB  |  134 lines

  1. /* @(#)mount.x    2.1 88/08/01 4.0 RPCSRC */
  2. /* @(#)mount.x 1.2 87/09/18 Copyr 1987 Sun Micro */
  3.  
  4.  
  5. /*
  6.  * Protocol description for the mount program
  7.  */
  8.  
  9.  
  10. const MNTPATHLEN = 1024;    /* maximum bytes in a pathname argument */
  11. const MNTNAMLEN = 255;        /* maximum bytes in a name argument */
  12. const FHSIZE = 32;        /* size in bytes of a file handle */
  13.  
  14. /*
  15.  * The fhandle is the file handle that the server passes to the client.
  16.  * All file operations are done using the file handles to refer to a file
  17.  * or a directory. The file handle can contain whatever information the
  18.  * server needs to distinguish an individual file.
  19.  */
  20. typedef opaque fhandle[FHSIZE];    
  21.  
  22. /*
  23.  * If a status of zero is returned, the call completed successfully, and 
  24.  * a file handle for the directory follows. A non-zero status indicates
  25.  * some sort of error. The status corresponds with UNIX error numbers.
  26.  */
  27. union fhstatus switch (unsigned fhs_status) {
  28. case 0:
  29.     fhandle fhs_fhandle;
  30. default:
  31.     void;
  32. };
  33.  
  34. /*
  35.  * The type dirpath is the pathname of a directory
  36.  */
  37. typedef string dirpath<MNTPATHLEN>;
  38.  
  39. /*
  40.  * The type name is used for arbitrary names (hostnames, groupnames)
  41.  */
  42. typedef string name<MNTNAMLEN>;
  43.  
  44. /*
  45.  * A list of who has what mounted
  46.  */
  47. typedef struct mountbody *mountlist;
  48. struct mountbody {
  49.     name ml_hostname;
  50.     dirpath ml_directory;
  51.     mountlist ml_next;
  52. };
  53.  
  54. /*
  55.  * A list of netgroups
  56.  */
  57. typedef struct groupnode *groups;
  58. struct groupnode {
  59.     name gr_name;
  60.     groups gr_next;
  61. };
  62.  
  63. /*
  64.  * A list of what is exported and to whom
  65.  */
  66. typedef struct exportnode *exports;
  67. struct exportnode {
  68.     dirpath ex_dir;
  69.     groups ex_groups;
  70.     exports ex_next;
  71. };
  72.  
  73. program MOUNTPROG {
  74.     /*
  75.      * Version one of the mount protocol communicates with version two
  76.      * of the NFS protocol. The only connecting point is the fhandle 
  77.      * structure, which is the same for both protocols.
  78.      */
  79.     version MOUNTVERS {
  80.         /*
  81.          * Does no work. It is made available in all RPC services
  82.          * to allow server reponse testing and timing
  83.          */
  84.         void
  85.         MOUNTPROC_NULL(void) = 0;
  86.  
  87.         /*    
  88.          * If fhs_status is 0, then fhs_fhandle contains the
  89.           * file handle for the directory. This file handle may
  90.          * be used in the NFS protocol. This procedure also adds
  91.          * a new entry to the mount list for this client mounting
  92.          * the directory.
  93.          * Unix authentication required.
  94.          */
  95.         fhstatus 
  96.         MOUNTPROC_MNT(dirpath) = 1;
  97.  
  98.         /*
  99.          * Returns the list of remotely mounted filesystems. The 
  100.          * mountlist contains one entry for each hostname and 
  101.          * directory pair.
  102.          */
  103.         mountlist
  104.         MOUNTPROC_DUMP(void) = 2;
  105.  
  106.         /*
  107.          * Removes the mount list entry for the directory
  108.          * Unix authentication required.
  109.          */
  110.         void
  111.         MOUNTPROC_UMNT(dirpath) = 3;
  112.  
  113.         /*
  114.          * Removes all of the mount list entries for this client
  115.          * Unix authentication required.
  116.          */
  117.         void
  118.         MOUNTPROC_UMNTALL(void) = 4;
  119.  
  120.         /*
  121.          * Returns a list of all the exported filesystems, and which
  122.          * machines are allowed to import it.
  123.          */
  124.         exports
  125.         MOUNTPROC_EXPORT(void)  = 5;
  126.  
  127.         /*
  128.          * Identical to MOUNTPROC_EXPORT above
  129.          */
  130.         exports
  131.         MOUNTPROC_EXPORTALL(void) = 6;
  132.     } = 1;
  133. } = 100005;
  134.